Prevent future-dated request from filling dbs#120
Merged
Conversation
…or coinmarketcap Coinmarketcap doesn't start populating historical rates until they are 5 minutes old
paullinator
approved these changes
Dec 2, 2025
| targetFiat: string, | ||
| requestedCrypto: CryptoRateMap, | ||
| requestedFiat: FiatRateMap, | ||
| rightNow: Date |
Member
There was a problem hiding this comment.
I would leave out this commit. This confuses the date that the request came in (rightNow) with the date the user requested. It made it much harder to review the next commit.
src/v3/utils.ts
Outdated
|
|
||
| // Ignore requests with a future time with an allowance for clients that are close enough | ||
| const isFutureTime = ( | ||
| rateTime: number, |
Member
There was a problem hiding this comment.
Just make rateTime be a Date object so you don't have to do getTime() everywhere you pass in the param.
to make sure you pass in the params in the right order, make it an object you pass with
{
date: Date
rightNow: Date
}
We can now filter rates based on their date compared to server time in the bucketing utils
2b62bb4 to
15c48e2
Compare
paullinator
approved these changes
Dec 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
noneDescription
none